package assetloader

import (
	"log"

	"github.com/hajimehoshi/ebiten/v2"
	"github.com/hajimehoshi/ebiten/v2/ebitenutil"
	"github.com/pkg/errors"
)

func NewImageFromFile(path string) *ebiten.Image {
	img, _, e := ebitenutil.NewImageFromFile(path)
	if e != nil {
		log.Fatal(errors.Wrap(e, path))
	}
	return img
}
